<?php
/**
* @package		JBS
* @license		GNU/GPL, see LICENSE.php
*/

jimport( 'joomla.application.component.view');

/**
 * HTML View class for the JBS Component
 *
 * @package		JBS
 */
class JBSViewJBS extends JView
{
	function display($tpl = null)
	{
		//Load pane behavior
		jimport('joomla.html.pane');

		//initialise variables
		$document	= & JFactory::getDocument();
		$pane   	= & JPane::getInstance('sliders');
		$user 		= & JFactory::getUser();


		//build toolbar
		JToolBarHelper::title( JText::_('PROJECT NAME'), 'jbschedule' );
		JToolBarHelper::help( 'el.intro', true );

		//$greeting = "ăn cơm";

		$this->assignRef( 'greeting', $greeting );
		$this->assignRef( 'user'	, $user );
		$this->assignRef( 'pane'	, $pane);
		parent::display($tpl);
	}

	/**
	 * Creates the buttons view
	 *
	 * @param string $link targeturl
	 * @param string $image path to image
	 * @param string $text image description
	 * @param boolean $modal 1 for loading in modal
	 */
	function quickiconButton( $link, $image, $text, $modal = 0 )
	{
		//initialise variables
		$lang 		= & JFactory::getLanguage();
  		?>

		<div style="float:<?php echo ($lang->isRTL()) ? 'right' : 'left'; ?>;">
			<div class="icon">
				<?php
				if ($modal == 1) {
					JHTML::_('behavior.modal');
				?>
					<a href="<?php echo $link.'&amp;tmpl=component'; ?>" style="cursor:pointer" class="modal" rel="{handler: 'iframe', size: {x: 650, y: 400}}">
				<?php
				} else {
				?>
					<a href="<?php echo $link; ?>">
				<?php
				}

					echo JHTML::_('image', 'administrator/components/com_jbschedule/media/images/48/'.$image, $text );
				?>
					<span><?php echo $text; ?></span>
				</a>
			</div>
		</div>
		<?php
	}
}
?>
